<?php

namespace adminApi\models\db;

use Carbon\Carbon;
use common\components\wtools\tools\Security;
use common\Tools;
use yii\web\IdentityInterface;

class Adminers extends \common\models\db\Adminers implements IdentityInterface
{
    public static function findIdentity($id)
    {
        return static::findOne($id);
    }

    public static function findIdentityByAccessToken($token, $type = null)
    {
        return static::findOne(['token' => $token]);
    }

    public function getId()
    {
        return $this->id;
    }

    public function getAuthKey()
    {
        return $this->auth_key;
    }

    public function validateAuthKey($authKey)
    {
        return $this->getAuthKey() === $authKey;
    }
}
